package model.semantics;

import java.util.List;

import model.State;
import model.TurtleState;

/**
 * Represents a generic unary operation.
 * @author Sterling Dorminey
 */
public abstract class UnaryOperation extends Operation<Integer> {

	public UnaryOperation() {
		super(1);
	}
	
	@Override
	protected Integer evaluateSafely(State<Integer> state, List<Integer> values) {
		return evaluateValue((TurtleState)state, values.get(0));
	}

    /**
     * Given a value, transform it into a new value.
     * 
     */
    protected abstract Integer evaluateValue(TurtleState state, Integer value);
}
